package com.ruoyi.system.interAttr.attr;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.interAttr.domain.GamesRes;
import com.ruoyi.system.interAttr.domain.InterAttr;
import com.ruoyi.system.interAttr.domain.InterAttrRes;
import com.ruoyi.system.interAttr.domain.InterServerRes;
import com.ruoyi.system.interAttr.mapper.InterAttrMapper;
import com.ruoyi.system.model.domain.SalePartner;
import com.ruoyi.system.outto.core.MapUntils;
import com.ruoyi.system.outto.dto.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.*;

@Service
@Slf4j
public class KKZHWAttr implements AdapterAttr {
    @Autowired
    InterAttrMapper interAttrMapper;

    /**
     * 根据接口游戏 id 获取接口游戏名称
     *
     * @param salePartner 合作商信息
     * @param gamesId     接口游戏 id
     * @return
     */
    private String getGamesName(SalePartner salePartner, String gamesId) {
        String interGameName = "";
        InterAttr interAttr = new InterAttr();
        // 根据合作商名称以及 gameId 获取数据
        String substring = salePartner.getSaleName().substring(salePartner.getSaleName().indexOf("_") + 1);
        interAttr.setConfigId(substring);
        interAttr.setInterGameId(gamesId);
        List<InterAttr> interAttrs = interAttrMapper.selectInterAttrList(interAttr);
        if (!interAttrs.isEmpty()) {
            interGameName = interAttrs.get(0).getInterGameName();
        }
        return interGameName;
    }

    /**
     * 获取游戏列表
     *
     * @param salePartner 合作商信息
     * @return
     */
    @Override
    public List<GamesRes> getGames(SalePartner salePartner) {
        String gamesUrl = "https://api2.kkzhw.com/mall-portal/openapi/import/product/list";
        long timestamp = System.currentTimeMillis();
        Map<String, String> headerParams = getHeaderParams(salePartner.getSaleKey(), timestamp);
        String sign = getSign(salePartner.getOther(), timestamp, "", "", true);
        headerParams.put("X-KK-SIGNATURE", sign);
        List<GamesRes> gamesResList = new ArrayList<>();
        try {
            log.info("看看账号游戏列表请求参数={}", headerParams);
            String response = HttpUtil.doGet(gamesUrl, null, headerParams);
            log.info("看看账号游戏列表返回参数={}", response);
            // 将结果返回转为 json 对象
            JSONObject gamesJson = JSONObject.parseObject(response);
            // 获取详细游戏信息
            List<JSONObject> gamesDataList = JSONObject.parseArray(gamesJson.getString("data"), JSONObject.class);
            for (JSONObject gameData : gamesDataList) {
                GamesRes gamesRes = new GamesRes();
                gamesRes.setId(gameData.getString("id"));
                gamesRes.setGameName(gameData.getString("name"));
                gamesResList.add(gamesRes);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return gamesResList;
    }

    /**
     * 获取游戏服务器
     *
     * @param gameId      游戏id
     * @param salePartner 合作商信息
     * @return
     */
    @Override
    public List<InterServerRes> getServer(String gameId, SalePartner salePartner) {
        String gameName = getGamesName(salePartner, gameId);
        // 获取游戏所有服务信息
        List<JSONObject> serversList = getServersAndProperties(salePartner, gameName, true);
        // 游戏服务器属性
        List<InterServerRes> serverResList = new ArrayList<>();
        if (!serversList.isEmpty()) {
            // 获取游戏服务对象信息
            JSONObject serversObj = serversList.get(0);
            // 获取服务信息
            String serversStr = serversObj.getString("inputList");
            // 判断服务是列表还是字符
            if (serversStr.startsWith("[{") && serversStr.endsWith("}]")) {
                // 如果服务为列表则转为 列表json
                List<JSONObject> gameServersList = JSONObject.parseArray(serversStr, JSONObject.class);
                for (JSONObject gameServers : gameServersList) {
                    InterServerRes interServerRes = new InterServerRes();
                    interServerRes.setUuid(UUID.randomUUID().toString());
                    interServerRes.setId(gameServers.getString("parent_name"));
                    interServerRes.setName(gameServers.getString("parent_name"));
                    // 获取下级游戏服务
                    List<InterServerRes> childrenInterServerResList = new ArrayList<>();
                    List<String> gameServersChildList = JSONObject.parseArray(gameServers.getString("childList"), String.class);
                    if (!gameServersChildList.isEmpty()) {
                        for (String gameServersChild : gameServersChildList) {
                            InterServerRes childrenInterServerRes = new InterServerRes();
                            childrenInterServerRes.setUuid(UUID.randomUUID().toString());
                            childrenInterServerRes.setId(gameServersChild);
                            childrenInterServerRes.setName(gameServersChild);
                            childrenInterServerResList.add(childrenInterServerRes);
                        }
                        interServerRes.setInterServerRes(childrenInterServerResList);
                    }
                    serverResList.add(interServerRes);
                }
            } else {
                //苹果QQ,苹果微信,安卓QQ,安卓微信
                String[] allServers = serversStr.split(",");
                for (String servers : allServers) {
                    InterServerRes interServerRes = new InterServerRes();
                    interServerRes.setUuid(UUID.randomUUID().toString());
                    interServerRes.setId(servers);
                    interServerRes.setName(servers);
                    serverResList.add(interServerRes);
                }
            }
        }
        return serverResList;
    }

    /**
     * 获取游戏属性信息
     *
     * @param gameId      游戏 id
     * @param type        属性选择类型
     * @param salePartner 合作商信息
     * @return
     */
    @Override
    public List<InterAttrRes> getPropety(String gameId, String type, SalePartner salePartner) {
        String gameName = getGamesName(salePartner, gameId);
        // 获取游戏所有属性信息
        List<JSONObject> propertiesList = getServersAndProperties(salePartner, gameName, false);
        // 返回结果集
        List<InterAttrRes> propertyResList = new ArrayList<>();
        if (!propertiesList.isEmpty()) {
            for (JSONObject properties : propertiesList) {
                // 将区服信息摘除
                if (StringUtils.isEmpty(properties.getString("ename"))) {
                    // 选择类型 0：数值/输入 1：单选 2：多选 3：上下级
                    String selectType = properties.getString("selectType");
                    // 判断匹配类型 1：单选 2：多选 3：数字以及输入
                    if (StringUtils.equals("1", type)) {
                        if (StringUtils.equals(selectType, "1")) {
                            assembleProperties(properties, propertyResList);
                        }
                    } else if (StringUtils.equals("2", type)) {
                        if (StringUtils.equals(selectType, "2")) {
                            assembleProperties(properties, propertyResList);
                        }
                    } else if (StringUtils.equals("3", type)) {
                        if (StringUtils.equals(selectType, "0")) {
                            InterAttrRes res = new InterAttrRes();
                            res.setUuid(UUID.randomUUID().toString());
                            res.setId(properties.getString("name"));
                            res.setName(properties.getString("name"));
                            res.setRequired(false);
                            propertyResList.add(res);
                        }
                    }
                }
            }
        }
        return propertyResList;
    }

    /**
     * 组装游戏属性信息
     *
     * @param properties      游戏属性对象
     * @param propertyResList 返回结果的集合
     */
    private static void assembleProperties(JSONObject properties, List<InterAttrRes> propertyResList) {
        // 创建匹配对象并赋值
        InterAttrRes propertyAttrRes = new InterAttrRes();
        propertyAttrRes.setUuid(UUID.randomUUID().toString());
        propertyAttrRes.setId(properties.getString("name"));
        propertyAttrRes.setName(properties.getString("name"));
        propertyAttrRes.setRequired(false);
        List<InterAttrRes> propertyInputList = new ArrayList<>();
        String[] propertyInputArray = properties.getString("inputList").split(",");
        for (String propertyInput : propertyInputArray) {
            InterAttrRes propertyInputRes = new InterAttrRes();
            propertyInputRes.setUuid(UUID.randomUUID().toString());
            propertyInputRes.setId(propertyInput);
            propertyInputRes.setName(propertyInput);
            propertyInputRes.setRequired(false);
            propertyInputList.add(propertyInputRes);
        }
        propertyAttrRes.setInterServerRes(propertyInputList);
        propertyResList.add(propertyAttrRes);
    }

    /**
     * 获取服务以及属性
     *
     * @param salePartner 合作商信息
     * @param gameName    游戏名称
     * @param isServers   是否获取服务信息
     * @return
     */
    private static List<JSONObject> getServersAndProperties(SalePartner salePartner, String gameName, boolean isServers) {
        StringBuffer propertyUrl = new StringBuffer();
        long timestamp = System.currentTimeMillis();
        propertyUrl.append("https://api2.kkzhw.com/mall-portal/openapi/import/product").append("/meta");
        Map<String, String> headerParams = getHeaderParams(salePartner.getSaleKey(), timestamp);
        Map<String, Object> params = new HashMap<>();
        params.put("gameName", gameName);
        String queryStr = StringUtils.stripEnd(MapUntils.getCover(params), "&");
        propertyUrl = propertyUrl.append("?").append(queryStr);
        String sign = getSign(salePartner.getOther(), timestamp, queryStr, "", true);
        headerParams.put("X-KK-SIGNATURE", sign);
        if (isServers) {
            log.info("看看账号服务列表请求参数={}", headerParams);
        } else {
            log.info("看看账号属性列表请求参数={}", headerParams);
        }
        String response = HttpUtil.doGet(propertyUrl.toString(), null, headerParams);
        if (isServers) {
            log.info("看看账号服务列表返回参数={}", headerParams);
        } else {
            log.info("看看账号属性列表返回参数={}", headerParams);
        }
        // 将结果转为 json 对象
        JSONObject ServersAndPropertiesJson = JSONObject.parseObject(response);
        // 获取游戏数据 json 对象
        JSONObject gameDataJson = ServersAndPropertiesJson.getJSONObject("data");
        // 获取游戏属性列表
        List<JSONObject> gameAttributeList = JSONObject.parseArray(gameDataJson.getString("extGameAttributeArrays"), JSONObject.class);
        for (JSONObject gameAttr : gameAttributeList) {
            if (StringUtils.equals(gameAttr.getString("ename"), "gameAccountQufu")) {
                if (isServers) {
                    List<JSONObject> serversList = new ArrayList<>();
                    serversList.add(gameAttr);
                    gameAttributeList = serversList;
                    break;
                } else {
                    gameAttributeList.remove(gameAttr);
                    break;
                }
            }
        }
        return gameAttributeList;
    }

    /**
     * 获取请求头参数
     *
     * @param apiKey    ⽤户的appKey
     * @param timestamp 当前的时间戳(毫秒)
     * @return
     */
    public static Map<String, String> getHeaderParams(String apiKey, long timestamp) {
        Map<String, String> gamesUrlParams = new HashMap<>();
        gamesUrlParams.put("X-KK-APIKEY", apiKey);
        gamesUrlParams.put("X-KK-TIME", String.valueOf(timestamp));
        return gamesUrlParams;
    }

    /**
     * 获取 sign 签名
     *
     * @param timestamp 时间戳
     * @param queryStr  请求串
     * @param queryBody 请求体
     * @param isGet     是否 get 请求
     * @return
     */
    public static String getSign(String apiSecret, long timestamp, String queryStr, String queryBody, boolean isGet) {
        String sign = "";
        String signature = timestamp + (!isGet ? "" : queryStr) + (isGet ? "" : queryBody);
        try {
            sign = HMACSHA256(signature, apiSecret);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return sign;
    }

    /**
     * HMACSHA256 加密参数
     *
     * @param data 加密数据
     * @param key  密钥
     * @return 加密结果
     * @throws Exception
     */
    static String HMACSHA256(String data, String key) throws Exception {
        try {
            Mac sha256Hmac = Mac.getInstance("HmacSHA256");
            SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
            sha256Hmac.init(secretKeySpec);
            byte[] hash = sha256Hmac.doFinal(data.getBytes(StandardCharsets.UTF_8));
            return bytesToHex(hash);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }

    private static String bytesToHex(byte[] bytes) {
        StringBuilder result = new StringBuilder();
        for (byte b : bytes) {
            result.append(String.format("%02x", b));
        }
        return result.toString();
    }

    public static void main(String[] args) throws InterruptedException {
        String c = "[\n    {\n        \"parent_name\": \"战士\",\n        \"childName\":\"二级专精\",\n        \"childList\": [\n            \"紫禁之巅\",\n            \"瑶光听雪\",\n            \"帝都风云\",\n            \"武林天骄\",\n            \"云川雪青\"\n        ]\n    },\n    {\n        \"parent_name\": \"圣骑士\",\n        \"childList\": [\n            \"东京梦华\",\n            \"应看千秋\",\n            \"铁马秋风\",\n            \"九天揽月\",\n            \"挑灯看剑\"\n        ]\n    },\n    {\n        \"parent_name\": \"游侠\",\n        \"childList\": [\n            \"烟雨江南\",\n            \"魔都风云\",\n            \"姑苏绮罗\",\n            \"西子湖畔\",\n            \"碧海问舟\"\n        ]\n    },\n    {\n        \"parent_name\": \"蛮斗士\",\n        \"childList\": [\n            \"武林萌主\",\n            \"问鼎江湖\",\n            \"天下无双\",\n            \"群龙之首\",\n            \"神龙九现\"\n        ]\n    },\n    {\n        \"parent_name\": \"吟游诗人\",\n        \"childList\": [\n            \"沧海月明\",\n            \"江山如画\",\n            \"两广豪杰\",\n            \"一蓑烟雨\",\n            \"君心如月\"\n        ]\n    },\n    {\n        \"parent_name\": \"牧师\",\n        \"childList\": [\n            \"燕字归时\",\n            \"绝代风华\",\n            \"玲珑相思\",\n            \"天外飞仙\",\n            \"天府之国\"\n        ]\n    },\n    {\n        \"parent_name\": \"幻灵祭司\",\n        \"childList\": [\n            \"江湖一梦\",\n            \"刀剑如梦\",\n            \"仲夏绮梦\",\n            \"游园惊梦\",\n            \"浮生若梦\"\n        ]\n    },\n    {\n        \"parent_name\": \"法师\",\n        \"childList\": [\n            \"踏月留香\",\n            \"宿命相逢\",\n            \"缘定三生\",\n            \"明月天涯\",\n            \"惊鸿照影\"\n        ]\n    },\n    {\n        \"parent_name\": \"影忍者\",\n        \"childList\": [\n            \"白帝霜华\",\n            \"千古风流\",\n            \"扶摇万里\",\n            \"飞花逐月\",\n            \"剑胆琴心\"\n        ]\n    }\n]";
        String allGames = "[{\"id\":75,\"name\":\"逆水寒手游\"},{\"id\":126,\"name\":\"诛仙世界\"},{\"id\":214,\"name\":\"逆水寒ol黄金服\"},{\"id\":218,\"name\":\"女娲石银两专区\"},{\"id\":117,\"name\":\"永劫无间手游\"},{\"id\":127,\"name\":\"永劫无间\"},{\"id\":79,\"name\":\"剑灵怀旧服\"},{\"id\":128,\"name\":\"逆水寒ol赛季服\"},{\"id\":112,\"name\":\"逆水寒ol正式服\"},{\"id\":113,\"name\":\"鸣潮\"},{\"id\":84,\"name\":\"DNF手游\"},{\"id\":81,\"name\":\"原神\"},{\"id\":78,\"name\":\"射雕2.0\"},{\"id\":80,\"name\":\"塔瑞斯世界\"},{\"id\":82,\"name\":\"王者荣耀\"},{\"id\":85,\"name\":\"元梦之星\"},{\"id\":98,\"name\":\"无畏契约\"},{\"id\":125,\"name\":\"魔兽世界怀旧服\"},{\"id\":97,\"name\":\"剑灵\"},{\"id\":124,\"name\":\"王权与自由\"},{\"id\":123,\"name\":\"英雄联盟\"},{\"id\":151,\"name\":\"绝地求生PUBG\"},{\"id\":119,\"name\":\"燕云十六声\"},{\"id\":118,\"name\":\"剑网3无界\"},{\"id\":122,\"name\":\"崩坏星穹铁道\"},{\"id\":116,\"name\":\"火影忍者手游\"},{\"id\":115,\"name\":\"和平精英\"},{\"id\":121,\"name\":\"穿越火线端游\"},{\"id\":114,\"name\":\"三国杀\"},{\"id\":135,\"name\":\"绝区零\"},{\"id\":134,\"name\":\"逆水寒天赏石\"},{\"id\":197,\"name\":\"激战2\"},{\"id\":184,\"name\":\"Apex英雄\"},{\"id\":185,\"name\":\"暗区突围\"},{\"id\":186,\"name\":\"巅峰极速\"},{\"id\":187,\"name\":\"暗黑破坏神:不朽\"},{\"id\":188,\"name\":\"守望先锋\"},{\"id\":189,\"name\":\"崩坏3\"},{\"id\":190,\"name\":\"坦克世界\"},{\"id\":191,\"name\":\"战舰世界\"},{\"id\":192,\"name\":\"NBA2KOL\"},{\"id\":193,\"name\":\"NBA2KOL2\"},{\"id\":194,\"name\":\"全明星街球派对\"},{\"id\":195,\"name\":\"跑跑卡丁车手游\"},{\"id\":196,\"name\":\"率土之滨\"},{\"id\":223,\"name\":\"燕云八音窍\"},{\"id\":198,\"name\":\"部落冲突\"},{\"id\":200,\"name\":\"古剑奇谭网络版\"},{\"id\":204,\"name\":\"三角洲行动\"},{\"id\":206,\"name\":\"万龙觉醒\"},{\"id\":213,\"name\":\"逆水寒手游国际服\"},{\"id\":225,\"name\":\"洛克王国\"},{\"id\":215,\"name\":\"漫威争锋\"},{\"id\":224,\"name\":\"剑灵2\"},{\"id\":220,\"name\":\"铜钱装备专区(逆水寒黄金服)\"},{\"id\":221,\"name\":\"决胜巅峰\"},{\"id\":222,\"name\":\"异人之下\"},{\"id\":158,\"name\":\"明日方舟\"},{\"id\":130,\"name\":\"金铲铲之战\"},{\"id\":143,\"name\":\"英雄联盟手游\"},{\"id\":144,\"name\":\"逆战\"},{\"id\":145,\"name\":\"出发吧麦芬\"},{\"id\":146,\"name\":\"幻塔\"},{\"id\":147,\"name\":\"蛋仔派对\"},{\"id\":148,\"name\":\"地下城与勇士\"},{\"id\":149,\"name\":\"瓦罗兰特\"},{\"id\":150,\"name\":\"穿越火线-枪战王者\"},{\"id\":154,\"name\":\"天涯明月刀ol\"},{\"id\":155,\"name\":\"天涯明月刀手游\"},{\"id\":156,\"name\":\"光遇\"},{\"id\":157,\"name\":\"三国谋定天下\"},{\"id\":183,\"name\":\"STEAM\"},{\"id\":159,\"name\":\"QQ三国\"},{\"id\":160,\"name\":\"命运方舟\"},{\"id\":161,\"name\":\"QQ飞车\"},{\"id\":162,\"name\":\"QQ飞车手游\"},{\"id\":163,\"name\":\"梦幻新诛仙\"},{\"id\":164,\"name\":\"黑色沙漠\"},{\"id\":165,\"name\":\"晶核\"},{\"id\":166,\"name\":\"七日世界\"},{\"id\":167,\"name\":\"明日之后\"},{\"id\":179,\"name\":\"忍者必须死\"},{\"id\":180,\"name\":\"尘白禁区\"},{\"id\":181,\"name\":\"幻唐志\"},{\"id\":182,\"name\":\"幻唐志：逍遥外传\"}]";
        String apiKey = "p7pFVXi2PyHUenXf";
        String apiSecret = "kLokjMXvsVstPxp7R4phEd84iKhRhGkV";
        String baseUrl = "https://api2.kkzhw.com/mall-portal/openapi/import/product";
        long timestamp = System.currentTimeMillis();
        // 获取游戏列表
        //getGames(apiKey, apiSecret, baseUrl, timestamp);
        // 获取游戏属性
//        List<JSONObject> jsonObjects = JSONObject.parseArray(allGames, JSONObject.class);
//        for (JSONObject game : jsonObjects) {
//                String gameName = game.getString("name");
//
//            Thread.sleep(3000);
//        }
        List<JSONObject> list = getServersAndProperties(apiKey, apiSecret, baseUrl, "光遇", true);
        for (JSONObject l : list) {
            if (l.getString("selectType").equals("3")) {
                System.out.println("游戏名称：" + "逆水寒ol黄金服" + "  property——type——3：" + l);
            }
        }//鸣潮 塔瑞斯世界 万龙觉醒 光遇
        String type = "";
        // 返回结果集
        List<InterAttrRes> propertyResList = new ArrayList<>();
        if (!list.isEmpty()) {
            for (JSONObject properties : list) {
                // 将区服信息摘除
                if (StringUtils.isEmpty(properties.getString("ename"))) {
                    // 选择类型 0：数值/输入 1：单选 2：多选 3：上下级
                    String selectType = properties.getString("selectType");
                    // 判断匹配类型 1：单选 2：多选 3：数字以及输入
                    if (StringUtils.equals("1", type)) {
                        if (StringUtils.equals(selectType, "1")) {
                            assembleProperties(properties, propertyResList);
                        }
                    } else if (StringUtils.equals("2", type)) {
                        if (StringUtils.equals(selectType, "2")) {
                            assembleProperties(properties, propertyResList);
                        }
                    } else if (StringUtils.equals("3", type)) {
                        if (StringUtils.equals(selectType, "0")) {
                            InterAttrRes res = new InterAttrRes();
                            res.setUuid(UUID.randomUUID().toString());
                            res.setId(properties.getString("name"));
                            res.setName(properties.getString("name"));
                            res.setRequired(false);
                            propertyResList.add(res);
                        }
                    }
                }
            }
        }
    }


    // 获取游戏列表
    static void getGames(String apiKey, String apiSecret, String baseUrl, long timestamp) {
        String gamesUrl = baseUrl + "/list";
        Map<String, String> headerParams = getHeaderParams(apiKey, timestamp);
        String sign = getSign(apiSecret, timestamp, "", "", true);
        headerParams.put("X-KK-SIGNATURE", sign);
        String response = HttpUtil.doGet(gamesUrl, null, headerParams);
        System.out.println(response);
    }

    private static List<JSONObject> getServersAndProperties(String apiKey, String apiSecret, String baseUrl, String gameId, boolean isServers) {
        StringBuffer propertyUrl = new StringBuffer();
        long timestamp = System.currentTimeMillis();
        propertyUrl.append("https://api2.kkzhw.com/mall-portal/openapi/import/product").append("/meta");
        Map<String, String> headerParams = getHeaderParams(apiKey, timestamp);
        Map<String, Object> params = new HashMap<>();
        params.put("gameName", gameId);
        String queryStr = StringUtils.stripEnd(MapUntils.getCover(params), "&");
        propertyUrl = propertyUrl.append("?").append(queryStr);
        String sign = getSign(apiSecret, timestamp, queryStr, "", true);
        headerParams.put("X-KK-SIGNATURE", sign);
        JSONObject ServersAndPropertiesJson = null;
        List<JSONObject> gameAttributeList = new ArrayList<>();
        try {
            String response = HttpUtil.doGet(propertyUrl.toString(), null, headerParams);
            // 将结果转为 json 对象
            ServersAndPropertiesJson = JSONObject.parseObject(response);
            // 获取游戏数据 json 对象
            JSONObject gameDataJson = ServersAndPropertiesJson.getJSONObject("data");
            // 获取游戏属性列表
            gameAttributeList = JSONObject.parseArray(gameDataJson.getString("extGameAttributeArrays"), JSONObject.class);
            for (JSONObject gameAttr : gameAttributeList) {
                if (StringUtils.equals(gameAttr.getString("ename"), "gameAccountQufu")) {
                    if (isServers) {
                        List<JSONObject> serversList = new ArrayList<>();
                        serversList.add(gameAttr);
                        gameAttributeList = serversList;
                        break;
                    } else {
                        gameAttributeList.remove(gameAttr);
                        break;
                    }
                }
            }
        } catch (Exception e) {
            log.error(ServersAndPropertiesJson.getString("message"));
        }
        return gameAttributeList;
    }
}
